﻿using System.Windows.Controls;
using System.Windows.Input;

namespace LS.DicomViewer
{
    /// <summary>
    /// Window.xaml 的交互逻辑
    /// </summary>
    public partial class ConfigWindow
    {
        UserControl view;
        public object Content
        {
            get => view;
            set
            {
                view = value as UserControl;
                content.Children.Insert(0, view);
                loading.DataContext = view.DataContext;
                this.KeyDown += (a, b) =>
                {
                    try
                    {
                        if (b.KeyboardDevice.Modifiers == ModifierKeys.Control)
                        {
                            view.RaiseEvent(b);
                        }
                    }
                    catch
                    {
                        b.Handled = true;
                    }
                };
            }
        }
        public ConfigWindow()
        {
            InitializeComponent();
        }
    }
}
